perm filename USEMUS.LCS[UP,DOC]2 blob
sn#163837 filedate 1975-06-19 generic text, type T, neo UTF8
********** Using the Music System -- MUS10 **********
******* (WORK IN PROGRESS -- JUNE, 75) *********
This manual is designed for use with the PDP10 at the Stanford AI lab.
It is quite possible that several features discussed will not be
operative on other installations. See appendix for some details.
MUS10 is a complete sound generating package which exists on the
disk. In its basic form it includes no storage area for sound output,
so when the program is to be run, a number, establishing the core
size, must be given following the program name.
For first attempts type:
R MUS10 10
(All lines must be terminated with the 'RETURN' key.)
At this point the program will type the message:
INPUT?
Basically there are two responses possible. If the program is to
receive further instructions from another file which has been
prepared with an editing program, type:
NAME -- where NAME is the name of the file to be read.
(If NAME has an extension, it must be used!)
If instructions are to be entered by means of the teletype keyboard
(TTY mode), type carriage return (<CR>).
At this point a star (*) will appear which means the program is
awaiting input.
Most complete statements to be read by MUS10 must end with a
semicolon. Several complete statements may be entered on a single
line but it is best not to have the lines too long. More than one
line may be used for a single statement. If the less-than sign (<)
appears everything following on that line will be ignored. Use this
for entering comments.
***** Note that the above rules DO NOT apply to the syntax
of the SCORE program.
Already present in MUS10 is an "instrument" known as SIMP which has
been set to play a test tone of 'A' (440 hz) for 1/2 second.
In order to play this tone, first get into TTY mode as described
above, then type:
PLAY;SIMP;FINISH;
When the computation has finished the note 'A' will be heard if the
various switches on the sound system are all in the right positions.
(See appendix for this information and information regarding the
filter settings.)
Assuming there were no typographical errors, you will know the comp-
utation is done by the appearance of another star (*). The test tone
may now be repeated several times by typing:
$P N where '$' indicates the 'ALT' key and 'N' is the
number of times the note will play.
If no sound has been heard up to this point repeat the above, using
some large number (e.g.20) for 'N' and go test the various switches
until the tones are heard.
Occasionally a message will appear:
HUNG DEVICE AD
If this happens get expert help.
******************************************************
The instrument SIMP has five parameters.
P1 = begin time of note (in seconds)
P2 = duration of note " "
P3 = pitch
P4 = amplitude
P5 = wave form (or timbre)
P1 and P2 will have the same significance in all instruments but all
higher numbered parameters are assigned roles according to
convenience. (However it will prove useful to consistently apply P3
and P4 as above.)
Internally all pitch entries become numerical, however the twelve
frequencies of the tempered chromatic scale, from middle C (261.62
hz) up to B may be used in MUS10 by typing the letter names of the
notes. The letter S = #; flats are not used in this program.
Since these letters merely represent the frequencies of each note,
the octave range may be changed multiplying or dividing by multiples
of two. Thus C or A in the octave below middle C would be entered
as C/2 or A/2. In the octave above the basic middle octave these
notes would be C*2 or A*2.
C -- 2 octaves down would be C/4
C -- 3 octaves down would be C/8
C -- 2 octaves up would be C*4
C -- 3 octaves up would be C*8 etc.
To test the use of these letters try:
P3←C;PLAY;SIMP;FINISH;
Now instrument SIMP will play middle C instead of A. The left arrow
(←) indicates that the value of C has been placed in P3, replacing
any value that was previously there. (The left arrow and the equals
sign[=] are interchangeable in this program.)
PLAY;SIMP;FINISH; must be typed so the new note will be computed.
After it is first heard it may be repeated as indicated above.
If frequencies other than those of the tempered scale are to be
played, a number may be used instead of a letter.
P3←1000;PLAY;SIMP;FINISH; will play a tone at 1000 hz.
The amplitude scale available is the range of number from 0 to 2047.
(This upper limit is set by the number of bits [12] used for the
sound samples. See appendix.) P4 has been set at 1200 for the test
tone. This may be reset using the same method as described before.
P4←100;P3←GS*2;PLAY;SIMP;FINISH;
This will play a G# above the middle octave at amplitude 100.
The duration of the tone may be changed be resetting P2.
P2←.1; etc. will play a note of 1/10 sec. duration.
If longer notes are desired the core being used must be expanded to
allow for more storage space. At the established sampling rate
(10000, see appendix.) 3.33k of core is needed for each second of
sound. Since 1/2" may be played when MUS10 has 10k, 14k is needed
for 1 1/2", 17k for 2 1/2", 20k for 3 1/2", etc. (Methods for
playing much longer examples are described in SCORE.MAN.)
********** SETTING CORE SIZE *********
To increase the core size type CALL, then C N where N is the core
size desired. Then type CON (=continue) to return to where you
previously were in the program.
When several parameters are to be changed at once the following
type-in format should be used:
PLAY;SIMP 0 .2 FS/2 850;FINISH;
This will play F# below middle C for 2/10" at an amplitude of 850.
(Please note that P5, the wave form for SIMP, will be dealt with
later.)
********** COMMAS **********
Commas may be used to separate the parameters and if nothing precedes
a comma the contents of that parameter remains unchanged. Also any
parameter numbers higher than the length of the list will not be
affected.
PLAY;SIMP ,.3,,1200;FINISH; changes only P2 and P4.
******************************************************
A string of notes may be played with the following input:
PLAY;SIMP 0 .2 C 1500;SIMP .2,,D;SIMP .4,,E;
SIMP .6,,C;FINISH;
In this case P1 must be updated for each note. (Never overlap an
instrument with itself. Distortion will occur.) P2, the note
duration remains unchanged, so the commas suffice for the last three
notes. P4, coming at the end of the list for the first note need
only be stated once if it is not to change.
Rests are created by simply leaving some time between the end of one
note (P1+P2) and the beginning of the next (the new P1).
PLAY;SIMP 0 .2 C;SIMP .5;FINISH; will play C for 2/10",
rest for 3/10" and then play another C for 2/10".
********** FUNCTIONS **********
The wave form in P5 is entered by means of a name which is used by
the program to locate a list, or array, of numbers (512) which
describe the wave. The names used for this purpose will always be F
followed directly by a number. These arrays will be called
"functions."
Only one function is in MUS10, although more can be added. The
function present is known as F1 and describes a sine wave. To see
this wave on the CRT type:
SEE(F1);
To clear the screen hit the 'ESC' key followed by a 'C'. (This is
called ESCAPE C.) <CR> will bring back the typescript display if it
is gone.
Functions may be created with an external program called FUNC or
within MUS10 itself by means of two routines called SYNTH and SEG.
SYNTH is used to create composites made by adding various harmonics
together. The form of F1 could be changed in the following manner:
SYNTH(F1); 1,1 2,1 3,.5 999;
In the three pairs of numbers the first of each pair represents the
harmonic number and the second the relative amplitude of that
harmonic. Thus the ratios of harmonics 1, 2 and 3 will be 1:1:.5 .
The size of the second number of each pair is important only in its
relation to the other amplitude numbers. The number 999 is used to
signal the termination of a string of entries.
Several pairs may entered and harmonic numbers up to 256 may be used
but in practice great care must be taken to avoid the "foldover"
effect which occurs when frequencies higher than one half the
sampling rate are present. (See appendix.)
It should be pointed out that the fundamental (harmonic #1) need not
be present in a wave.
SYNTH(F1); 10,1 12,1 15,1 999; will give the three notes of a
minor chord. After this has been entered the following will cause a
C minor chord to play:
PLAY;SIMP 0 .5 GS/8;FINISH;
While the lowest Ab (or G#) on the piano keyboard has been indicated,
since the wave form includes only the 10th, 12th and 16th harmonics,
the notes middle C, Eb and G will be heard.
Several experiments with different wave forms should be made. Be
sure to SEE the waves so a visual-aural connection might be made.
A function may be changed in the middle of PLAY routine but it must
be noted that the new wave definition must follow! the note which it
is to affect.
In PLAY;SIMP 0 .3 D 1000;SIMP .3;SYNTH(F1); 1,.7 3,.2
5,.1 999;SIMP .6,,E;FINISH; the newly defined wave
will be heard in the second and third notes.
If you wish to have several functions with different names available
and you do not create them with the FUNC program, their names must be
"declared" to MUS10. Suppose you wish to have F2, F3 and F4. You
must type directly to MUS10 (or into an EDIT file which will be read
by MUS10) the following:
ARRAY F2,F3,F4(512);
The "(512)" indicates that each function array will require 512 words
of storage. Thus at this point the free storage left for sound
samples has been reduced by 1 1/2K so you must increase the size of
your core if you want to have the same amount of playing time as
before.
The following example will play a sequence of notes wherein are heard
the 10th, 14th and 18th harmonics of a low C, then the 10th, 13th and
16th, and finally the 10th, 12th and 14th harmonics.
As each SYNTH function is typed in the wave will be
displayed. If you wish a clear screen after the last one has
appeared, hit the 'ESC' key followed by a 'C'. (This is called ESCAPE
C.)
ARRAY F2,F3(512);
SYNTH(F1);10,1 14,1 18,1 999;
SYNTH(F2);10,1 13,1 16,1 999;
SYNTH(F3);10,1 12,1 14,1 999;
PLAY;SIMP 0 .3 C/4 2000 F1;
SIMP .3,,,,F2;SIMP .6,,,,F3;FINISH;
A type of flow-chart diagram for SIMP would appear as follows:
P4 MAG*P3
| |
↓ ↓
***************
* * OSCIL
* * U1 (UNIT GENERATOR ONE)
* P5 *
* *
* *
*********
|
↓
*****
* OUT *
* A *
*****
The top left input, P4, serves simply as a multiplier for the numbers
found in the wave form array, P5. The particular number from the
array to be multiplied is determined by the number in the upper right
input. The upper right input, in this case P3, when processed by
"MAG" (the "magic" number) becomes the increment, the rate at which
the wave form array is stepped through. The "magic" number is found
by dividing the array length, 512, by the sampling rate, 10000.
512/SRATE=.0512 (Higher sampling rates will be discussed later.)
The maximum size of the numbers in the wave array is + or -1. Thus
if P4 is set to 1000 the output of the OSCIL will be numbers in the
range +1000 to -1000 which will describe the wave form put into P5
cycling at the rate given in P3.
The code for entering this instrument follows:
COMPILE;
INSTRUMENT SIMP;
OSCIL(P4,MAG*P3,P5);
OUTA←OUTA+U1;
END;
FINISH;
Several instruments may appear between COMPILE; and FINISH;.
This instrument has only one unit generator (the OSCIL) hence the
output of U1 is added to the contents of OUTA. If there are several
instruments the outputs of all the instruments will be combined in
OUTA for each sample.
It will be noticed when playing instrument SIMP that the sound begins
and ends quite abruptly. This is because no attack-decay envelope
has been applied to the tone. The sound begins at the full amplitude
of P4 and remains at that level for its total duration.
To apply an envelope, another unit generator must be added.
P4 MAG/P2
| |
↓ ↓
***************
* * OSCIL
* * U1 (UNIT GENERATOR ONE)
* P5 *
* *
* *
*********
|
| MAG*P3
| |
↓ ↓
***************
* * OSCIL
* * U2 (UNIT GENERATOR TWO)
* P6 *
* *
* * COMPILE;
********* INSTRUMENT TOOT;
| OSCIL(P4,MAG/P2,P5);
↓ OSCIL(U1,MAG*P3,P6);
***** OUTA←OUTA+U2;
* OUT * END;
* A * FINISH;
*****
Now that the instrument has been expanded you will note that it is
the output of unit generator two (U2) which goes to OUTA.
P5 will now contain the envelope array. This array is best defined
by the SEG routine. SEG defines the positions of line segments used
to approximate a curve. With SEG several pairs of numbers may be
entered. The first number of each pair is an amplitude, normally in
the range of 0 to 1, and the second is the step number in the array.
The step numbers 1 through 100 are used in SEG. (However internally,
512 array locations are used.) Straight line segments are drawn
between each of the points defined. The following would put a
triangular envelope shape into F2:
ARRAY F2(512);
SEG(F2); 0,1 1,50 0,100;
Note that the routine is terminated when step 100 is reached.
DO NOT USE 999 with SEG.
After having typed in the code for instrument TOOT and the definition
for an envelope in F2, the following will produce a note using that
envelope:
SYNTH(F1);1,1 2,.4 3,.1 999;< Sets the tone color.
PLAY;TOOT 0 .5 A 2000 F1 F2;FINISH;
If two envelopes are to be contrasted add another function and define
it.
ARRAY F3(512);
SEG(F3); 0,1 1,7 .2,25 .1,60 0,100;< Staccato
PLAY;TOOT 0 .2 1000 2000 F3 F1; < P5 has envelope
TOOT .2 .5,,,F2;FINISH;<Plays stac. then sust.(F1 then F2)
In the next example a unit generator will be added above the right
side of the bottom, tone producing unit generator. In this way a
function may be used to describe fluctuations of pitch within the
duration of a note -- much as the previous example gave the
possibility for changing the amplitude during a single note.
MAG*P7-MAG*P3 MAG/P8
P4 MAG/P2 | |
| | ↓ ↓
↓ ↓ ***************
*************** * * OSCIL
* * OSCIL * * U2
* * U1 * P9 *
* P5 * * *
* * * *
* * *********
********* MAG*P3 |
| | _____________|
|________ _↓___↓_
| \ /
| \ + /
| \_/
| |
↓ ↓
***************
* *
OSCIL * *
U3 * P6 *
* *
* * COMPILE;
********* INSTRUMENT GLISS;
| OSCIL(P4,MAG/P2,P5);
↓ OSCIL(MAG*P7-MAG*P3,MAG/P8,P9);
***** OSCIL(U1,MAG*P3+U2,P6);
* OUT * OUTA←OUTA+U3; END; FINISH;
* A *
*****
In order for this instrument to perform glissandos, a third function
must be defined for P9 (the "shape" of the glissando). A straight
line slope will suffice for a simple glissando. After typing in the
instrument definition set up the three functions.
ARRAY F5,F6(512); <F1 is already present.
SEG(F5);0,1 .8,7 1,12 1,90 0,100;<Envelope
SEG(F6);0,1 1,100; <Slope
In the preceding, the ARRAY declaration is needed only when some new
function names are to be used.
The following will play a glissando up two octaves, from C to C*4.
PLAY; GLISS 0 1 C 2000 F5 F1 C*4 1 F6; FINISH;
If P8←.5; (while P2 remains at 1) two glissandos will be heard.
This same instrument may be used to produce a vibrato by putting a
sine wave into P9, setting P8←1/7; (the vibrato rate will be 7 times
per second) and making P7 some very small amount different from P3.
PLAY; GLISS 0 1 C 2000 F5 F1 C+2 1/7 F1; FINISH;
(It is assumed that F1 is a sine wave.)
Various types of noise and other random fluctuations are
produced by the two random number unit generators. These are called
RANDH and RANDI. RANDH (H=hold) produces in effect a function made
up of horizantal lines at various levels with a perpendicular jump
from one level to the next. There are two inputs to RANDH. The
first (left hand) gives the range, plus or minus, of random
selection and the second (right hand) gives the rate (per second) at
which the selections are to be made.
Care must be taken with the number in the first input. If
the number 100 is given, the output of RANDH will fluctuate between
+100 and -100. Thus if a range of 100 to 200 is desired, the input
number should be 50 and the number 150 must be added to the output.
MAG*P7 MAG*P8
P4 MAG/P2 | |
| | ↓ ↓
↓ ↓ ***************
*************** * *
* * OSCIL * RANDH * U2
* * U1 ***************
* P5 * |
* * |
* * |
********* MAG*P3 |
| | _____________|
|________ _↓___↓_
| \ /
| \ + /
| \_/
| |
↓ ↓
***************
* *
OSCIL * *
U3 * P6 *
* *
* * COMPILE;
********* INSTRUMENT NOISE;
| OSCIL(P4,MAG/P2,P5);
↓ RANDH(MAG*P7,MAG*P8);
***** OSCIL(U1,MAG*P3+U2,P6);
* OUT * OUTA←OUTA+U3; END; FINISH;
* A *
*****
ARRAY F5(512); <F1 is already present.
SEG(F5);0,1 .8,7 1,12 1,90 0,100;<Env.
The following will produce white noise.
SRATE←25000;MAG←512/SRATE;SPEED←2;
PLAY;NOISE 0 .5 C*8 1000 F2 F1 P3 P3*4;FINISH;
Actually P8 (given as P3*4) can probably be left at a number
like 4000 for noise purposes. As P7 is changed the apparent
band-width of the noise will be changed. As the band-width gets
narrower the center frequency becomes more apparent. Thus if P7←P3/16
and P3 is up in the range of C*8, something of the effect of blowing
across an open tube will be produced. The pitch is clear -- but
quite windy.
The SRATE (sampling rate) must be increased for noise
production since very high frequencies are essential. At SRATE←25000
the high frequency cut-off will be at 12500 hz.
If P8 is set to a low number (e.g. 8) individual random
pitches, instead of noise, will be produced at that rate.
If the random unit generator is replaced by a RANDI the
random function produced will be made up of a series of slopes
(I=interpolating) up and down from one random point to another. In
the case of noise production there is little difference between RANDI
and RANDH. However RANDI is necessary for getting such things as
random vibrato. The following will produce an acceptable, "human"
sounding vibrato.
PLAY; NOISE 0 1 C*2 1000 F2 F1 P3*.01 16; FINISH;
The random rate of 16 per second (in P8) is considerably
faster than the human vibrato rate of 5 to 8 per second. In this
case however since the full band-width (in P7) is only seldom
attained and the heard effect is that of a rate much slower than 16.
Frequency modulation allows for the production of a wide
variety of tone colors using relatively little compute time. The
INTRP unit generator is really just a combination of an OSCIL and an
ADD box. The left input represents the output when the function (P10
below) is at zero and the right input represents the output when the
function is at 1 (peak amplitude). No time input is given with
INTRP. The speed of stepping through the function array is always
taken as being P2, i.e. the note duration. In this case P10 will
contain an envelope which will control the changes in frequency
modulation. For a full explanation of FM see John Chowning's AES
Journal article on this subject.
P9*P7*MAG P8*P9*MAG
| |
↓ ↓
***************
* *
* P10 * INTRP
* * U2
* *
* *
* *
* P9*MAG
P4 MAG/P2 | |
| | ↓ ↓
↓ ↓ ***************
*************** * * OSCIL
* * OSCIL * * U3
* * U1 * P11 *
* P5 * * *
* * * *
* * *********
********* MAG*P3 |
| | _____________|
|________ _↓___↓_
| \ /
| \ + /
| \_/
| |
↓ ↓
***************
* *
OSCIL * *
U4 * P6 *
* *
* * COMPILE;
********* INSTRUMENT FM;
| OSCIL(P4,MAG/P2,P5);
↓ INTRP(P7*P9*MAG,P8*P9*MAG,P10);
***** OSCIL(U2,P9*MAG,P11);
* OUT * OSCIL(U1,U3+P3*MAG,P6);
* A * OUTA←OUTA+U4; END; FINISH;
*****
The following functions should be set up to test the FM instrument.
ARRAY F1,F2,F3(512);
SYNTH(F1); 1 1 999; < A sine wave.
SEG(F2);0,1 .9,4 1,8 1,72 .8,88 .5,95 0,100; < Envelope
SEG(F3); 0,1 1,100; < An upward slope or ramp.
The following will produce a shift from a pure sine tone to a
highly modulated tone over a period of 2 seconds.
PLAY; FM 0 2 100 1000 F2 F1 0 10 100 F3 F1; FINISH;
To reverse the procedure, i.e. change from the modulated tone
to the pure tone, reverse the values of P7 and P8.
P7←10; P8←0; PLAY;FM;FINISH;
Change F3 (the ramp) to make the modulation emerge only in
the mid-part of the note.
SEG(F3); 0,1 1,50 0,100; < Makes a pyramid.
PLAY;FM;FINISH;
Try several of the variations suggested in Chowning's article.
********** APPENDIX XXX NOT COMPLETE!!!XXX ************
The main program for sound generation is currently called MUSIC.FAI
or MUSEXP.FAI (EXP=export). The export version is designed to run on
a standard PDP10 DEC system (which has a "FAIL" compiler.)
The main program must be loaded with two subroutine packages which
are called MUSF4.F4 (OR MUSEXP.F4) and MUSIO.FAI (or EXPIO.FAI.) The
FORTRAN routines are for the creation of function arrays and for
organizing the output of sound samples to tape or disk after they
have been computed. The FAIL routines are for fast output of blocks
of samples.
The STANFORD version can play sound from core or write all samples on
an external device for playback with another program. The latter
method is always used for sounds longer than about 10 seconds.
See SCORE.LCS[UP,DOC] for information on longplaying features (RCDFLG
and BIGBIT) and much other information.
************** FILTER SETTINGS **********
The filter switches are near the floor roughly behind the
PDP6. For the purposes of the tests described in this document the
setting for channel 1, the right hand switch, should always be at 5K.
This means that frequencies higher than 5000 hz will be suppressed.
For later experiments with NOISE and FM it may be desired to change
the setting to 12.5 K. If this is done however sound run by other
users at the lowest sampling rate (10000, SPEED 3) will always
include the sampling tone of 5000 hz. The switch at the top of the
cabinet should be left at 5 K.
************ LOCAL SPEAKERS ***********
To hear sound produced by the D-A converter from the small
speaker associated with your TTY console hit the 'ESC' key followed
by the '4', and then the 'U'. (ESCAPE 4 U).
********* SOME INFO RE. THE 'FUNC' PROGRAM ***********
CRUNCH: Any two functions already in a single .DAT file may be
"crunched" together. Also, a function may be created by either the
SEG or SYNTH routines and then if instead of typing "F" for FINISH
the letter "Z" is typed the program will jump immediately to "crunch"
mode. At this point the new function may be combined with any
function found in the file presently in core. Note however that once
this new function is processed by any of "crunch" options its
original form cannot be regained without going back to ordinary SEG
or SYNTH mode.
PLOTTING: If "SP" (=see on the plotter) is typed single functions
can be drawn on the Calcomp plotter. The size asked for is in
inches. "SA" (=see all on plotter) will plot all the functions found
in a single file. "SX" (=see all on the XGP) will draw all functions
from a single file in the proper size for printing by the XGP. In
order to use "SX" you must!!! follow the next steps exactly!!!
Before running FUNC type: A DSK PTP <CR>. This will cause the
instructions FUNC sends to the plotter to be written in a
file on the disk.
When FUNC asks you once more about what you want to do
(you have already typed "SX" <CR> and then the appropriate
file name) hit the "CALL" key.
Then type F <CR>. This finishes off the DSK file which
has just been written.
Then type R X <CR>. This runs a program called X which
converts plotter information to XGP commands.
X will ask you 5 questions. You should answer as follows:
PLOT.BIN <CR> (the file name)
<CR> (plot slice?)
5 <CR> (shift 5 inches)
<CR> (use default value of 11".)
1 <CR> (1 inch from the left)
Y (yes, delete the plot file)
Information re. WAVES. To run it type R WAVES.
This will allow you to display the actual wave shapes of sound
computed using RCDFLG←-1;. The MUSAA.DMD file thus produced is read
by WAVES.
You may display up to 3072 samples at a time but since only 1024
separate positions can be shown at once, larger numbers will cause
some samples to be skipped over (but with no great loss.) After each
group of samples is displayed a <CR> will move on to the next group.
If a number is typed, that will set the extent of the next group. If
the number -1 is given, the program will automatically cycle through
all available samples by groups of the last given number. (When no
more samples are to be found it will end with an error message.) In
order to make the program go backwards type any number less than
-2 for the number of samples you wish to back up.
This program should be of use in seeing the wave shapes produced by
amplitude and frequency modulation as well as seeing the effects of
foldover, etc. Composite waves from more than one voice may be
displayed but as the complexity increases it may prove rather
difficult to glean useful information from what is seen.